Skip to main content

Configuration of the Generic CiA402 Axis

CODESYS SoftMotion provides drivers for various drives. If no specific driver is available for the CiA402 drive which you are using, then you can use the generic CiA402 axis.

However, the compatibility and behavior of the generic axis depend largely on the CiA402 implementation in the respective drive. In practice, it has been shown that different manufacturers interpret the CiA402 standard differently – particularly with regard to error handling and support for limit switches.

Therefore, it cannot be guaranteed that the generic CiA402 axis will always function correctly or completely with a particular drive.

Note

The generic CiA402 driver supports up to 8 axes in case the device description of the drive does not specify a number. Otherwise, the number of axes defined in the device description is supported.

CANopen: The number of possible axes depends on the profiles of the logical devices in the EDS file (1000H object and 67FFH + X * 800H, where X = number of logical devices). For more details, see the CANopen CiA301 standard.

EtherCAT: The number of possible axes depends on the defined CiA402 channels (CoE DS402Channels) in the ESI file.

An adaptation of the EDS or ESI file needs to be done by the device manufacturer.

Objects used when commissioning

When commissioning, the following objects are accessed if they are supported by the device.

Object

Read/Write Access

(M)andatory

(O)ptional

Comment

0x1000:0

Read

M

The lower value has to be 402. Otherwise cancel.

0x1018:1

Read

O

0x1018:2

Read

O

0x1018:3

Read

O

0x1018:4

Read

O

0x6502:0

Read

O

0x605A:0

Read

O

0x60C2:1

Write

If parameter Set60C2 = TRUE

0x60C2:2

Write

If parameter Set60C2 = TRUE

0x6076:0

Read

O

Objects used during operation

The following objects are used during operation depending on the functions used:

0x603F:00, 0x6040:00, 0x6041:00, 0x6060:00, 0x6061:00, 0x6062:00, 0x6064:00, 0x606B:00, 0x606C:00, 0x6074:00, 0x6077:00, 0x6078:00, 0x607C:00, 0x60B1:00, 0x60B2:00,0x60B8:000x60B9:00, 0x60BA:00, 0x60BB:00, 0x60BC:00, 0x60BD:00, 0x60F4:00.

Advanced configuration

Important

You need to select the Show generic device configuration views option in the Options: Device editor dialog so that the tab with the parameters is displayed.

You can use the following parameters to fine-tune the flow of the CiA402 state machine.

CiA402 Parameter

Description

_readVelocityFactor_6096

TRUE: The velocity factor (object 6096) is read and used to convert the velocity units.

FALSE: The velocity factor is not read. The velocity unit is assumed to be increments per second.

_bImmediateDisabling

TRUE: When bRegulator is reset to FALSE, switches the status of the drive from Operation enabled directly to Switch on disabled.

FALSE: Switches the status via "Switched on" and "Ready to switch on", giving the drive the chance to execute a quickstop and handle the brake properly.

Note: If this option is set to FALSE, then the states for which immediate disabling is switched off can be fine-tuned with the bit mask _dwStatesImmediateDisabling.

_bForbidReenableDuringDisabling

Only relevant when _bImmediateDisabling = FALSE.

TRUE: The drive is disabled step-by-step until the drive signals to be in Ready to switch on before a new enable command is processed.

dwStatesImmediateDisabling

Only relevant when _bImmediateDisabling = FALSE.

Bit mask of the states for which immediate disabling is turned on.

  • Bit 0: Normal Operation

  • Bit 1: Quickstop

  • Bit 2: External Quickstop

  • Bit 3: Homing

Example: Assuming _bImmediateDisabling = FALSE, the value 2#0110 means that the immediate disabling is turned off only for the states "Normal Operation" and "Homing". For states “Quickstop" and "External Quickstop", immediate disabling is turned on.

_uiPreHomingWait

Number of cycles which the state machine waits in state PRE_HOMING before starting the homing process by setting bit 4 of the control word.

_uiPostHomingWait

Number of cycles which the state machine stays in HOMING_DONE before switching back to "Normal Operation".

_uiHomingMinCycles

Number of cycles at the beginning of HOMING, where the done bits (bit 10/12 of the status word) are ignored.

_uiWaitCyclesForStateSwitch

Number of cycles which the system waits until the drive has executed a state change command. If the drive fails, then the system will switch back to SWITCH_ON_DISABLED.

_bPreHomingWaitBit12Clear

TRUE: Wait in PRE_HOMING until bit 12 of the status word has been cleared by the drive before starting homing (before setting bit 4 of the control word).

Note that in any case, the state machine stays in PRE_HOMING for at least _uiPreHomingCycles.

_bCheckBit10PostHoming

TRUE: Switch to HOMING_DONE if bit 12 and bit 10 of the status word are both TRUE (as specified in CiA-402).

FALSE: Ignore bit 10; only use bit 12.

_bCheckOpMode

TRUE: Check if 0x6061 shows the value set in 0x6060 when enabling the axis.

FALSE: Omit this check and enable immediately after setting the operation mode.

_abyControllerMode

This ARRAY[0..7] OF BYTE contains the operation modes (object 0x6060) which correspond with AXIS_REF_SM3.byOperationMode. (index 0,3 = position; index 1 = velocity; index 2 = torque)

_bCheckBit12InPositionMode

TRUE: AxisIsReadyForMotion checks bit 12 in CSP or IP.

FALSE: AxisIsReadyForMotion does not check bit 12.

_bDoHaltWhenStopInterruptsHome

TRUE: When MC_Stop interrupts, abort homing with bit 8 of the control word.

FALSE: Do not set bit 8, but directly switch the operation mode.

_bCheckBit13InHomingMode

TRUE: In HOMING_ACTIVE, wStatusWord.13 = TRUE leads to errorstop and (depending on _bDoHaltWhenStopInterruptsHome) wControlWord.8 := TRUE.

_bSetControlBit4InCSP

TRUE: Set bit 4 of status word also in CSP mode. Some drives require this, although it is non-standard.

_uiHomingWaitListeningBits101213

In state HOMING_ACTIVE, do not listen to bits 10, 12, and 13 during this number of cycles from setting bit 4. (Some drives take some time to reset these bits).

_bRegulatorOnRequiresVoltageEnabled

Whether bit 4 of the status word (voltage enabled) needs to be TRUE so that bRegulatorRealState = TRUE (default value: FALSE).

_bDriveStartRequiresOperationEnabled

Whether bit 2 of the status word (operation enabled) needs to be TRUE so that bDriveStartRealState = TRUE (default value: TRUE).

_modeOfOperation_Torque

The ModeOfOperation to be used for controller mode torque. Must behave like the cyclic sync torque mode.

_modeOfOperation_Velocity

The ModeOfOperation to be used for controller mode velocity. Must behave like the cyclic sync velocity mode.

_modeOfOperation_Position

The ModeOfOperation to be used for controller mode position. Must behave like the cyclic sync position mode.

_bStayInSwitchOnDisabled

FALSE: An automatic transition from SWITCH_ON_DISABLED to READY_TO_SWITCH_ON is performed, if either MC_Power.bDriveStart is TRUE or the quick stop option code (object 0x605A:00) is > 4.

TRUE: The transition from SWITCH_ON_DISABLED to READY_TO_SWITCH_ON is only done if MC_Power.bRegulatorOn is TRUE.

Touch Probe

The MC_TouchProbe function block requires a TRIGGER_REF as an input. TRIGGER_REF.iTriggerNumber has the following meaning for the generic CiA402 axis:

TRIGGER_REF.iTriggerNumber

Meaning

0

Touch probe 1, positive edge

1

Touch probe 1, negative edge

2

Touch probe 2, positive edge

3

Touch probe 2, negative edge

Error diagnosis: The drive cannot be switched on via MC_Power

The generic axis expects the following bits in the status word in order to return MC_Power.Status = TRUE:

  • Bit 0 (ready to switch on)

  • Bit 1 (switched on)

  • Bit 2 (operation enabled)

  • Bit 5 (quick stop)

  • Bit 12

    However, Bit 12 is not set by every drive. If the drive does not set the bit, then the _bCheckBit12InPositionMode parameter of the generic axis can be set to FALSE.